package com.vne.skyemart.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "userlog",catalog = "skyemart_db")
public class UserLog implements Serializable{
/**
	 * 
	 */
	private static final long serialVersionUID = 1667180437901138333L;
	//ID
	@Id
	@GeneratedValue
	@Column(name = "UserLogID", nullable = false, unique = true)
	private int userLogID;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UserID", nullable = false)
	private ADUser adUser;

	@Temporal(TemporalType.DATE)
	@Column(name = "LoginTime")
	private Date loginTime;

	@Temporal(TemporalType.DATE)
	@Column(name = "LogoutTime")
	private Date logoutTime;


	@Column(name = "IPAddress", length = 20)
	private String iPAddress;

	@Column(name = "MacAddress", length = 20)
	private String macAdress;

	public UserLog() {}

	public UserLog(int userLogID, ADUser adUser, Date loginTime,
			Date logoutTime, String iPAddress, String macAdress) {
		this.userLogID = userLogID;
		this.adUser = adUser;
		this.loginTime = loginTime;
		this.logoutTime = logoutTime;
		this.iPAddress = iPAddress;
		this.macAdress = macAdress;
	}

	public int getUserLogID() {
		return userLogID;
	}

	public void setUserLogID(int userLogID) {
		this.userLogID = userLogID;
	}

	public ADUser getAdUser() {
		return adUser;
	}

	public void setAdUser(ADUser adUser) {
		this.adUser = adUser;
	}

	public Date getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	public Date getLogoutTime() {
		return logoutTime;
	}

	public void setLogoutTime(Date logoutTime) {
		this.logoutTime = logoutTime;
	}

	public String getiPAddress() {
		return iPAddress;
	}

	public void setiPAddress(String iPAddress) {
		this.iPAddress = iPAddress;
	}

	public String getMacAdress() {
		return macAdress;
	}

	public void setMacAdress(String macAdress) {
		this.macAdress = macAdress;
	}
	
	
	
	
}
